Skip to content

Conversation

@mokagio
Copy link
Contributor

@mokagio mokagio commented Jun 16, 2025

Description

I'm working on simplifying hardware to be a Swift package, but the tests fail in CI, #15744

Investigating locally, I run into an unrelated test failure in ReceiptRenderer.

image

The reason it fails on my machine but not in CI is that the MD5 we check against was generated based on a different locale and time zone.

Once Locale and TimeZone are made static in the tests, everything is green again.


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary. — N.A.

@mokagio mokagio force-pushed the mokagio/fix-hardware-test-ausralia branch from 52570a9 to e3ddbb3 Compare June 16, 2025 19:09
@mokagio mokagio requested review from a team and jaclync June 16, 2025 19:10
@mokagio mokagio added this to the 22.7 milestone Jun 16, 2025
mokagio added 2 commits June 17, 2025 05:10
This decouples the tests from the location of the dev machine that runs
them.
@mokagio mokagio force-pushed the mokagio/fix-hardware-test-ausralia branch from e3ddbb3 to 25806b6 Compare June 16, 2025 19:11
@mokagio mokagio enabled auto-merge June 16, 2025 19:11
@wpmobilebot
Copy link
Collaborator

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Number30477
VersionPR #15759
Bundle IDcom.automattic.alpha.woocommerce
Commit25806b6
Installation URL25beek89fkhc0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link
Contributor

@jaclync jaclync left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests already passing locally (before and after), thanks for making them more resilient :shipit:

Comment on lines +8 to +9
let locale = Locale(identifier: "en_US_POSIX")
let timeZone = TimeZone(secondsFromGMT: 0)!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: these could be private

Suggested change
let locale = Locale(identifier: "en_US_POSIX")
let timeZone = TimeZone(secondsFromGMT: 0)!
private let locale = Locale(identifier: "en_US_POSIX")
private let timeZone = TimeZone(secondsFromGMT: 0)!


let renderer = ReceiptRenderer(content: content)

print(renderer.htmlContent())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, looks like a debug print.

@mokagio mokagio merged commit 525de6e into trunk Jun 17, 2025
13 checks passed
@mokagio mokagio deleted the mokagio/fix-hardware-test-ausralia branch June 17, 2025 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants